import React, { Component } from 'react'

import PropsType from 'prop-types'
export class MainBanner extends Component {

  static defaultProps = {
    banner: [],
    title: '默认标题'
  }

  constructor(props) {
    super(props)
    this.state = {
      banner: props.banner,
      title: props.title
    }
  }
  render () {
    const { title, banner } = this.state;
    return (
      <div>
        <h1>{title}</h1>
        <ul>
          {
            banner.map(item => {
              return <li key={item.title}>{item.title}</li>
            })
          }
        </ul>
      </div>
    )
  }
}
// 属性类型
MainBanner.propsType = {
  name: PropsType.string,
  bannerList: PropsType.array,
}

export default MainBanner
